package com.vizhuo.client.business.match.goods.vo;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.vizhuo.client.base.AbstractVo;
import com.vizhuo.client.business.match.goods.constant.addOrderConstant;

/**
 * 当日发货推送记录
 * 
 * @ClassName: AppDayGoodspush
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author TANDP
 * @date 2015-8-11 下午7:44:16
 * 
 */
public class AppDayGoodspushVo extends AbstractVo implements Serializable {
    private Long id;

    /**
     * 货源id
     */
    private Long goodsId;

    /**
     * 货源编号
     */
    private String goodsNo;

    /**
     * 发货人账号id
     */
    private int accountId;

    /**
     * 货物摘要
     */
    private String goodsRemark;

    /**
     * 推送时间
     */
    private Date pushTime;

    /**
     * 接收人账号/手机号
     */
    private String receiveAccount;

    /**
     * 状态,未抢,已抢,已成交
     */
    private String state;

    /**
     * 长途或者同城
     */
    private String distanceType;

    /**
     * 用车时间
     */
    private String needCarTime;

    /**
     * 取货详细地址
     */
    private String startAddress;

    /**
     * 送货详细地址
     */
    private String endAddress;

    /**
     * 距离
     */
    private String distance;

    /**
     * 发货人商店名称
     */
    private String shopName;

    /**
     * 运输起点省编码
     */
    private String startProvice;//

    /**
     * 运输起点市编码
     */
    private String startCity;//

    /**
     * 运输起点区编码
     */
    private String startCounty;//

    /**
     * 运输起始省市区名称
     */
    private String startAreaName;

    /**
     * 运输终点省编码
     */
    private String endProvice;//

    /**
     * 运输终点市编码
     */
    private String endCity;//

    /**
     * 运输终点区编码
     */
    private String endCounty;//

    /**
     * 运输终点省市区名称
     */
    private String endAreaName;

    public String getStartProvice() {
        return startProvice;
    }

    public void setStartProvice(String startProvice) {
        this.startProvice = startProvice;
    }

    public String getStartCity() {
        return startCity;
    }

    public void setStartCity(String startCity) {
        this.startCity = startCity;
    }

    public String getStartCounty() {
        return startCounty;
    }

    public void setStartCounty(String startCounty) {
        this.startCounty = startCounty;
    }

    public String getStartAreaName() {
        return startAreaName;
    }

    public void setStartAreaName(String startAreaName) {
        this.startAreaName = startAreaName;
    }

    public String getEndProvice() {
        return endProvice;
    }

    public void setEndProvice(String endProvice) {
        this.endProvice = endProvice;
    }

    public String getEndCity() {
        return endCity;
    }

    public void setEndCity(String endCity) {
        this.endCity = endCity;
    }

    public String getEndCounty() {
        return endCounty;
    }

    public void setEndCounty(String endCounty) {
        this.endCounty = endCounty;
    }

    public String getEndAreaName() {
        return endAreaName;
    }

    public void setEndAreaName(String endAreaName) {
        this.endAreaName = endAreaName;
    }

    public String getDistanceType() {
        return distanceType;
    }

    public void setDistanceType(String distanceType) {
        this.distanceType = distanceType;
    }

    public String getNeedCarTime() {
        if (needCarTime == null || needCarTime.equals("")) {
            return needCarTime;
        }

        // 格式化用车时间，长途订单显示年月日，同城显示年月日时分
        DateFormat dfTongCheng = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        DateFormat dfChangTu = new SimpleDateFormat("yyyy-MM-dd");
        try {
            // 同城
            if (this.getDistanceType() != null && this.getDistanceType().equals(addOrderConstant.TYPE_SAME_CITY)) {
                Date dateTongCheng = dfTongCheng.parse(needCarTime);
                return dfTongCheng.format(dateTongCheng);
            } else {
                Date dateChangTu = dfChangTu.parse(needCarTime);
                return dfChangTu.format(dateChangTu);
            }
        } catch (ParseException e) {
            e.printStackTrace();
            return "";
        }
    }

    public void setNeedCarTime(String needCarTime) {
        this.needCarTime = needCarTime;
    }

    public String getStartAddress() {
        return startAddress;
    }

    public void setStartAddress(String startAddress) {
        this.startAddress = startAddress;
    }

    public String getEndAddress() {
        return endAddress;
    }

    public void setEndAddress(String endAddress) {
        this.endAddress = endAddress;
    }

    public String getDistance() {
        return distance;
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsNo() {
        return goodsNo;
    }

    public void setGoodsNo(String goodsNo) {
        this.goodsNo = goodsNo;
    }

    public int getAccountId() {
        return accountId;
    }

    public void setAccountId(int accountId) {
        this.accountId = accountId;
    }

    public String getGoodsRemark() {
        return goodsRemark;
    }

    public void setGoodsRemark(String goodsRemark) {
        this.goodsRemark = goodsRemark;
    }

    public Date getPushTime() {
        return pushTime;
    }

    public void setPushTime(Date pushTime) {
        this.pushTime = pushTime;
    }

    public String getReceiveAccount() {
        return receiveAccount;
    }

    public void setReceiveAccount(String receiveAccount) {
        this.receiveAccount = receiveAccount;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

}